package o;

import android.text.TextUtils;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class edk extends BaseSharedPref {
    private static edk ˊ;

    private String ˊ() {
        return new SimpleDateFormat("yyyyMMdd", Locale.US).format(new Date(System.currentTimeMillis()));
    }

    private edk() {
    }

    public static synchronized edk ˏ() {
        edk o_edk;
        synchronized (edk.class) {
            if (ˊ == null) {
                ˊ = new edk();
            }
            o_edk = ˊ;
        }
        return o_edk;
    }

    public void ˏ(String str) {
        if (!TextUtils.isEmpty(str)) {
            int ˊ = ˊ(str);
            int i = 1;
            if (-1 != ˊ) {
                i = ˊ + 1;
            }
            ˋ(str, ˊ() + "#" + i);
        }
    }

    public void ॱ(String str) {
        ʼ(str);
    }

    public int ˊ(String str) {
        int i = -1;
        Object ॱ = ॱ(str, "");
        if (!TextUtils.isEmpty(ॱ)) {
            String[] split = ॱ.split("#");
            if (split.length == 2) {
                if (ˊ().equals(split[0])) {
                    try {
                        i = Integer.parseInt(split[1]);
                    } catch (NumberFormatException e) {
                        Logger.ˎ("PoorNetDownloadRecord", "can not get download fail times: " + e.toString());
                    }
                } else {
                    ʼ(str);
                }
            }
        }
        return i;
    }
}
